package com.xk.androiddemo;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;

import com.github.mikephil.charting.data.PieEntry;

import com.xk.androiddemo.databinding.ActivityNetBinding;
import com.xk.androiddemo.utils.UIUtils;


import java.util.ArrayList;
import java.util.List;

public class NetActivity extends AppCompatActivity {

    ActivityNetBinding bind;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        bind = ActivityNetBinding.inflate(getLayoutInflater());
        setContentView(bind.getRoot());
        List<PieEntry> pieEntries = new ArrayList<>();
        pieEntries.add(new PieEntry(0.45f, "")); // 您已经添加的条目
        pieEntries.add(new PieEntry(0.55f, "")); // 新增一个占比为20%的条目
        UIUtils.showPieChart(bind.pieChart, pieEntries);
        bind.backIcon.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        bind.clWen.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent =new Intent(NetActivity.this, TActivity.class);
                startActivity(intent);
                finish();
            }
        });
    }
}